import { ElMessage } from 'element-plus'

export class Permission {
    key;
    constructor(key:string){
        this.key = key
    }
    getPermission(){
       const p = localStorage.getItem(this.key)
       if(p == null){
            ElMessage.error("用户无权限访问！");
            return;
       }
      const permissionJson = JSON.parse(p);
      if(permissionJson.select){
        return permissionJson;
      }
     ElMessage.error("用户无权限访问！");
     return
    }
}
